<html>
<head><meta charset="utf-8"><title>rust-analyzer is fast :-( · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html">rust-analyzer is fast :-(</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167969313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167969313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167969313">(Jun 12 2019 at 17:32)</a>:</h4>
<p>Logical continuation of [rust-analyzer is slow :-(](<a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20is.20slow.20.3A-()" title="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20is.20slow.20.3A-()">https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20is.20slow.20.3A-()</a>.</p>
<p>After my recent optimizations, I can no longer reproduce slow on enter. However other folks can! I expect that this is due to my laptop being to fast (it's a relatively beefy machine). </p>
<p>I'd love to add "slow connection mode" to rust-analyzer, which restricts the amount of CPU it can use. How should I implement this thing?</p>
<p>Ideally, I'd love to do some syscall from within rust-analyzer procces, like "self-limit me to at most 30% CPU". In theory, I can use cgroups and/or thread affinity for that.  However, I've looked into this today, and I don't think I can easily write this thing: existing cgroups bindings are pretty low-level and require me to know more about cgroups than I want at this moment. And the set_affinity syscall works on per-thread basis. </p>
<p>Do folks have any suggestions for self-restricting CPU in as little lines of code as possible? Should I .... just exec myself using some Linux command-line utility?</p>



<a name="167969678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167969678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167969678">(Jun 12 2019 at 17:37)</a>:</h4>
<p>you can also set the nice to a larger value, but I'm not sure it's a good idea</p>



<a name="167969705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167969705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167969705">(Jun 12 2019 at 17:37)</a>:</h4>
<p>if you throttle RA, you'll end up waiting more for it to return the results</p>



<a name="167969886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167969886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167969886">(Jun 12 2019 at 17:39)</a>:</h4>
<p>maybe a better approach is to wait a little before processing the client requests? like that old "wait 250ms before showing completions" trick</p>



<a name="167970049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970049">(Jun 12 2019 at 17:41)</a>:</h4>
<p>Hm, I think CPU throttling is exactly what I want here? Like, I want to expose existing slow bits of code, and I don't know where they are, so I don't know where to insert the sleep calls</p>



<a name="167970165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970165">(Jun 12 2019 at 17:42)</a>:</h4>
<p>Ah, got it. I thought you wanted to slow down RA to help people with slower computers, but it's for testing.</p>



<a name="167970206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970206">(Jun 12 2019 at 17:43)</a>:</h4>
<p>yeah, I want to slow RA to help people with fast computers :D</p>



<a name="167970330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970330">(Jun 12 2019 at 17:44)</a>:</h4>
<p><a href="https://scoutapm.com/blog/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups" target="_blank" title="https://scoutapm.com/blog/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups">https://scoutapm.com/blog/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups</a></p>



<a name="167970333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970333">(Jun 12 2019 at 17:44)</a>:</h4>
<p><code>cpulimit</code>?</p>



<a name="167970387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970387">(Jun 12 2019 at 17:45)</a>:</h4>
<p>it even works for processes that are already running</p>



<a name="167970429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970429">(Jun 12 2019 at 17:45)</a>:</h4>
<blockquote>
<p>It does this by sending SIGSTOP and SIGCONT signals to the process.</p>
</blockquote>



<a name="167970451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970451">(Jun 12 2019 at 17:45)</a>:</h4>
<p><span aria-label="joy cat" class="emoji emoji-1f639" role="img" title="joy cat">:joy_cat:</span></p>



<a name="167970567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970567">(Jun 12 2019 at 17:47)</a>:</h4>
<p>yeah, I figure cgroups are a better approach today. And I also want to do this from withing a process.</p>
<p>Really, I'd love to use <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> crate with the following API:</p>
<div class="codehilite"><pre><span></span><span class="n">hardmode</span>::<span class="n">limit_cpu_frac</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span><span class="w"></span>
</pre></div>



<a name="167970616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970616">(Jun 12 2019 at 17:47)</a>:</h4>
<p>Is anyone interested in building ^^ :)</p>



<a name="167970626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970626">(Jun 12 2019 at 17:47)</a>:</h4>
<p>as a debugging aid, that <code>cpulimit</code> thing seems nice</p>



<a name="167970651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970651">(Jun 12 2019 at 17:47)</a>:</h4>
<p>I mean it's awful, but.. :D</p>



<a name="167970781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nbiba Bedis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970781">(Jun 12 2019 at 17:49)</a>:</h4>
<p>But the api looks really cool its tempting xD</p>



<a name="167970890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nbiba Bedis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970890">(Jun 12 2019 at 17:50)</a>:</h4>
<p>for the Irust crate</p>



<a name="167970893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nbiba Bedis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970893">(Jun 12 2019 at 17:50)</a>:</h4>
<p>A rust repl</p>



<a name="167970894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167970894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nbiba Bedis <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167970894">(Jun 12 2019 at 17:50)</a>:</h4>
<p>for the Irust crate</p>



<a name="167974424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167974424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marcogroppo <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167974424">(Jun 12 2019 at 18:30)</a>:</h4>
<p>you can use cgroups via Docker (in this case with <code>--cpus=XX</code>). <code>systemd-run</code> should work too I think</p>



<a name="167975979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/167975979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#167975979">(Jun 12 2019 at 18:50)</a>:</h4>
<p>I think you can also create a cgroup manually (you need to be root), then assign RA to it while it's running</p>



<a name="168064701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168064701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jordan Miner <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168064701">(Jun 13 2019 at 17:09)</a>:</h4>
<p>I posted a couple of traces on the "slow on enter" issue. The computer I was using is a quad core (8 hyperthread) 2.4GHz laptop with 28GB of RAM. Rust, the standard library, VS Code, and rust-analyzer are all on an SSD, but the project is on a hard drive. I just set up Event Tracing for Windows on this machine, and managed to record a trace when enter took a couple seconds to appear. It looks like nothing else is using the CPU during the time, just rust-analyzer using 100% of a single core.</p>



<a name="168064845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168064845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168064845">(Jun 13 2019 at 17:10)</a>:</h4>
<p>Hm, interesting! That's are more powerful setup than mine, except for  hard-drive part</p>



<a name="168065235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168065235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jordan Miner <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168065235">(Jun 13 2019 at 17:15)</a>:</h4>
<p>If I'm using Windows Performance Analyzer right, it looks like a lot of time is spent in starting threads? Have you tried it on Windows? Maybe the panic implementation is different on Windows or Windows is a lot slower at creating threads?<br>
<a href="/user_uploads/4715/dkChTzOu0SKdImdp-aajocgo/slow-on-enter1.png" target="_blank" title="slow-on-enter1.png">slow-on-enter1.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/dkChTzOu0SKdImdp-aajocgo/slow-on-enter1.png" target="_blank" title="slow-on-enter1.png"><img src="/user_uploads/4715/dkChTzOu0SKdImdp-aajocgo/slow-on-enter1.png"></a></div>



<a name="168065298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168065298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jordan Miner <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168065298">(Jun 13 2019 at 17:16)</a>:</h4>
<p>The blue vertical line in the graph is the keyboard enter event.</p>



<a name="168065542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168065542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168065542">(Jun 13 2019 at 17:19)</a>:</h4>
<p>hm, fascinating!</p>



<a name="168065565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168065565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168065565">(Jun 13 2019 at 17:19)</a>:</h4>
<p>let me reboot into widndows and check....</p>



<a name="168066481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168066481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168066481">(Jun 13 2019 at 17:30)</a>:</h4>
<p>isn't it spending time in diagnostics?</p>



<a name="168066585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168066585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168066585">(Jun 13 2019 at 17:31)</a>:</h4>
<p>also collecting backtraces for <code>failure</code></p>



<a name="168066702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168066702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168066702">(Jun 13 2019 at 17:32)</a>:</h4>
<p>do you see any panics in the log window? sometimes RA seems to get stuck for a while throwing an awful lot of panics or errors</p>



<a name="168067078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168067078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jordan Miner <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168067078">(Jun 13 2019 at 17:36)</a>:</h4>
<p>I see one panic in the log window, and it doesn't show any symbols in the stack trace.</p>



<a name="168067125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168067125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168067125">(Jun 13 2019 at 17:37)</a>:</h4>
<blockquote>
<p>Windows is a lot slower at creating thread? </p>
</blockquote>
<p>Windows is much slower at creating threads and <del>panics</del> unwinds are also more expensive due to SEH.</p>



<a name="168067140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168067140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168067140">(Jun 13 2019 at 17:37)</a>:</h4>
<p>why do you say it's spending a lot of time creating threads?</p>



<a name="168068015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168068015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jordan Miner <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168068015">(Jun 13 2019 at 17:47)</a>:</h4>
<p>Yeah, I was wrong about that. I think it is spending a decent amount of time collecting backtraces, but I'm trying ti figure out how much.</p>



<a name="168068396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168068396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168068396">(Jun 13 2019 at 17:51)</a>:</h4>
<p><span class="user-mention" data-user-id="198951">@Jordan Miner</span> you are my hero! <span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span></p>



<a name="168068420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168068420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168068420">(Jun 13 2019 at 17:51)</a>:</h4>
<p>I've just tried this on windows, and yeah, that's backtraces we collect during cancellation</p>



<a name="168070221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168070221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168070221">(Jun 13 2019 at 18:09)</a>:</h4>
<p>wait, isn't cancellation using panics? those look like backtraces from <code>failure</code></p>



<a name="168071271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168071271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168071271">(Jun 13 2019 at 18:20)</a>:</h4>
<p>And I think it's unlikely for that to have a real impact on interactivity</p>



<a name="168071429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20is%20fast%20%3A-%28/near/168071429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20is.20fast.20.3A-(.html#168071429">(Jun 13 2019 at 18:21)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> you are also correct I think! We convert cancellation to <code>failure::Error</code> and I thing that's actually the point where we collect the backtrace, not the original <code>resue_unwind</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>